<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
	<title>Time</title>
	<script type="text/javascript"\ >
	window.onload = function(){
	run();
	}
	function run() {
	setInterval("showTime()", 500);
	}
	function showTime() {

	//新建一个Date对象

	var today = new Date();

	//分別获得年月日


	var month = today.getMonth() + 1;
	var day = today.getDate();

	//获得星期几

	var weekday =["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];

	//获得时分秒

	var hour = today.getHours();
	hour = check(hour);
	var min = today.getMinutes();
	min = check(min);

	document.getElementById("time").innerHTML = hour + ":" + min ;
    document.getElementById("date").innerHTML =  month + "月" + day + "日" + " "+ weekday[today.getDay()] ;
	}

	//自动补零

	function check(x) {
	if (x < 10) {
	x = "0" + x;
	}
	return x;
	}
</script>
<style>
    #time{
        font-family: arial, sans-serif;
        font-size: 160px;
        text-align: center;
        color: rgba(255,255,255,1);
        text-shadow: 0 2px 3px #464646;
    }
        #date{
        font-family: arial, sans-serif;
        font-size: 24px;
        text-align: center;
        color:rgba(255,255,255,0.8);
    }
</style>
</head>
<body>
	<div id="time"></div>
	<div id="date"></div>
</body>
</html>